import {adminUrl} from "@/utils/baseUrl.js"
import request from '@/utils/request'

// 创建请假事由
export function createAttendanceLeaveReason(data) {
  return request({
    url: adminUrl + '/study/attendance-leave-reason/create',
    method: 'post',
    data: data
  })
}

// 更新请假事由
export function updateAttendanceLeaveReason(data) {
  return request({
    url: adminUrl + '/study/attendance-leave-reason/update',
    method: 'put',
    data: data
  })
}

// 删除请假事由
export function deleteAttendanceLeaveReason(id) {
  return request({
    url: adminUrl + '/study/attendance-leave-reason/delete?id=' + id,
    method: 'delete'
  })
}

// 获得请假事由
export function getAttendanceLeaveReason(id) {
  return request({
    url: adminUrl + '/study/attendance-leave-reason/get?id=' + id,
    method: 'get'
  })
}

// 获得请假事由分页
export function getAttendanceLeaveReasonPage(query) {
  return request({
    url: adminUrl + '/study/attendance-leave-reason/page',
    method: 'get',
    params: query
  })
}

// 导出请假事由 Excel
export function exportAttendanceLeaveReasonExcel(query) {
  return request({
    url: adminUrl + '/study/attendance-leave-reason/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
